Skip to content

Conversation

siverne
Copy link
Member

@siverne siverne commented Nov 10, 2026

Part of #19.

  • Adds node-pg-migrate. Migrations are plain SQL files in backend/migrations/.
  • The first migration contains the existing tables (wine and community_rating). It uses IF NOT EXISTS, so it does nothing on databases that already have the tables, and only marks itself as run.
  • Removes sql/schema.sql and the db:schema script. Use npm run db:migrate instead.
  • New scripts: db:migrate, db:migrate:down and db:migrate:create.
  • README and docs updated.

After pulling: run npm ci and npm run db:migrate in backend/.
After merging: run the same on the VM.

Tested locally: migration runs, 24 backend tests pass, typecheck passes.

@siverne siverne requested a review from a team as a code owner November 10, 2026 14:49
@siverne siverne mentioned this pull request Nov 10, 2026
Copy link
Member

@oscarba oscarba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm:)

@oscarba oscarba merged commit 3ed3d46 into main Nov 11, 2026
@manerlan manerlan deleted the 19-migrations branch November 18, 2026 10:24
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants